// src/api/video/config.js
import request from '@/utils/request'

// 保存配置
export function saveConfig(data) {
    return request({
        url: '/video/video/config/save',
        method: 'post',
        data
    })
}

// 保存配置多数字人
export function saveMultiConfig(data) {
    return request({
        url: '/video/video/config/multi/save',
        method: 'post',
        data
    })
}

// 获取配置列表
export function getConfigList(params) {
    return request({
        url: '/video/video/config/list',
        method: 'get',
        params
    })
}

// 获取配置列表多数字人
export function fetchMultiAvatarConfig(id) {
    return request({
        url: `/video/video/config/multi/${id}`,
        method: 'get',
    })
}

// 设置默认配置
export function setDefaultConfig(id) {
    return request({
        url: `/video/video/config/${id}/default`,
        method: 'put'
    })
}

// 设置默认配置
export function setCaptionConfig(id) {
    return request({
        url: `/video/video/config/${id}/caption`,
        method: 'put'
    })
}

// 获取默认配置
export function getDefaultConfig() {
    return request({
        url: `/video/video/config/default/list`,
        method: 'get',
    })
}

// 获取多数字人默认配置
export function getMultiConfig() {
    return request({
        url: `/video/video/config/default/multi`,
        method: 'get',
    })
}

// 删除配置
export function deleteConfig(id) {
    return request({
        url: `/video/video/config/${id}`,
        method: 'delete'
    })
}

// 删除配置多数字人
export function removeMultiConfig(id) {
    return request({
        url: `/video/video/config//multi/${id}`,
        method: 'delete'
    })
}

// 批量删除配置
export function batchDeleteConfigs(ids) {
    return request({
        url: `/video/video/config/batchDelete`,
        method: 'delete',
        data: { ids }
    })
}

// 批量删除配置
export function syncKeyAvatars() {
    return request({
        url: `/video/api/v1/avatar/sync`,
        method: 'get',
    })
}

// 批量删除配置
export function getLastSyncAvatarInfo() {
    return request({
        url: `/video/api/v1/avatar/sync/info`,
        method: 'get',
    })
}